<?
/*
 * Copyright 2004-2005 Sigve Indregard.
 *
 * This file is part of Laivsys.
 *
 * Laivsys is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Laivsys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Laivsys; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * $Id: design.php 6 2005-07-11 23:14:47Z say $
 */
 
function headline ($tekst) {
	?>
	<div class="headline"><?=$tekst?></div>
	<?
}

function text ($tekst, $convert=true) {
	if ($convert)
		$tekst = txt2html($tekst);
	?>
	<div class="text">
	<?=$tekst?>
	</div>
	<?
}

function txt2html ($tekst) {
	//make dos unix
	$tekst = str_replace("\r\n", "\n", $tekst);
	//convert unix newline to html br
	$tekst = str_replace("\n", "<br/>\n", $tekst);
	//mac anyone?
	$tekst = str_replace("\r", "<br/>\n", $tekst);

	return $tekst;
}

function isodateformat ($isodate) {
	return strftime("%d.%m.%Y", strtotime($isodate));
}
?>
